package cn.org.xuanguang.kepler.hormos.orm.service;

import cn.org.xuanguang.kepler.hormos.orm.dao.HormsBaseSyncRepository;
import cn.org.xuanguang.kepler.hormos.rdb.dml.operator.NativeDmlOperator;
import cn.org.xuanguang.kepler.hormos.rdb.dml.operator.delete.DeleteOperator;
import cn.org.xuanguang.kepler.hormos.rdb.dml.operator.insert.InsertOperator;
import cn.org.xuanguang.kepler.hormos.rdb.dml.operator.select.SelectOperator;
import cn.org.xuanguang.kepler.hormos.rdb.dml.operator.update.UpdateOperator;

/**
 * service总入口
 */
public interface IService<E, K> {
    /**
     * 获取repository
     *
     * @return
     */
    public HormsBaseSyncRepository<E, K> getRepository();


    default InsertOperator createInsertOperator() {
        return getRepository().getDml().createInsertOperator();
    }

    default UpdateOperator createUpdateOperator() {
        return getRepository().getDml().createUpdateOperator();
    }

    default DeleteOperator createDeleteOperator() {
        return getRepository().getDml().createDeleteOperator();
    }

    default SelectOperator<E, K> createSelectOperator() {
        return getRepository().getDml().createSelectOperator();
    }

    default NativeDmlOperator<?> createNativeDmlOperator() {
        return getRepository().getDml().createNativeDmlOperator();
    }

}
